/**
 * 结算窗口基础类
 */
var JieSuanWindow = Window.extend({
    /**
     * 初始化
     * @param data 结算数据
     */
    initWindow: function (data, room) {
        this._super();
        this._data = data;
        this._room = room;
        this._initInfo(this._data);
        if (window.inReview) {
            safeHide(this._nodeList['btn_fenxiang']);
            this._nodeList['btn_chakan'].x = 0;
        }
    },
    /**
     * 初始化界面
     * @private
     */
    _initInfo: function () {

    },
    /**
     * 关闭界面
     * @public
     */
    close: function () {
        eventManager.dispatchEvent(EventKey.ReceiveJieSuanReady, false);
        this.removeFromParent(true);
    },
    /**
     * 添加点击
     * @private
     */
    _initClickListeners: function () {
        this._super();
        this._clickListeners = {
            'btn_start': '_clickStart',
            'btn_fenxiang': '_clickShare',
            'btn_chakan': '_clickChaKan'
        };
    },
    /**
     * 开始游戏
     * @private
     */
    _clickStart: function () {
        network.send(3004, {room_id: gameData.roomId});
        eventManager.dispatchEvent(EventKey.ReceiveJieSuanReady, true);
        this.removeFromParent(true);

    },
    /**
     * 分享结算
     * @private
     */
    _clickShare: function () {
        ShareUtil.SharePic(this);
        // WeChatUtil.shareCapture(this);
    },
    /**
     * 查看总战绩
     * @private
     */
    _clickChaKan: function () {
        this.removeFromParent(true);
    },
});